// test_invoice_processing.js
const { app } = require('egg');

// 模拟发票数据
const invoiceData = {
  "url": "/szzhzz/qlfpcx/v1/queryFpjcxx?6eMrZlPH=adb520869482ca2607dcd87050f8e20d7c2dcf4cc356575e16a96eb4baf6e7aa55c9c6a9da902bb2b5930373073954bcf55cdb5641a90d4d5ed85be281b97d26c06414bda00b3ffeef02b9edfac483adde5b7a246f571e64880e5517c611a2ad709cd2755c1933838316e029f76aec34",
  "method": "POST",
  "timestamp": "2025-11-23T14:26:41.791Z",
  "response": {
    "Response": {
      "RequestId": "8db9a892e8ef5544",
      "Data": {
        "PageNumber": 1,
        "PageSize": 20,
        "Total": 2,
        "List": [
          {
            "Gjbq": "1",
            "Fphm": "25332000000530054993",
            "Zzfphm": "",
            "ZzfpDm": "",
            "FplyDm": "2",
            "FplxDm": "81",
            "FppzDm": "01",
            "FpztDm": "01",
            "Sflzfp": "Y",
            "Kpfnsrsbh": "91330106MADX54C99B",
            "Xsfnsrsbh": "91330106MADX54C99B",
            "Xsfmc": "杭州科技有限公司",
            "Gmfnsrsbh": "91110108682896990A",
            "Gmfmc": "行丰有限公司",
            "Kprq": "2025-11-21 13:18:07",
            "Hjje": 9900.99,
            "Hjse": 99.01,
            "XsfssjswjgDm": "13300000000",
            "GmfssjswjgDm": "11100000000",
            "FpkjfsDm": "1",
            "Kpr": "徐根福",
            "Jshj": 10000,
            "Gmfzrrbz": "N",
            "Tdyslxmc": "",
            "Xsfssjswjgmc": "国家税务总局浙江省税务局"
          },
          {
            "Gjbq": "1",
            "Fphm": "25332000000530153125",
            "Zzfphm": "",
            "ZzfpDm": "",
            "FplyDm": "2",
            "FplxDm": "82",
            "FppzDm": "02",
            "FpztDm": "01",
            "Sflzfp": "Y",
            "Kpfnsrsbh": "91330106MADX54C99B",
            "Xsfnsrsbh": "91330106MADX54C99B",
            "Xsfmc": "杭州小采有限公司",
            "Gmfnsrsbh": "91340111MA8NQ3J465",
            "Gmfmc": "合肥科技有限公司",
            "Kprq": "2025-11-21 13:08:57",
            "Hjje": 8811.88,
            "Hjse": 88.12,
            "XsfssjswjgDm": "13300000000",
            "GmfssjswjgDm": "13400000000",
            "FpkjfsDm": "1",
            "Kpr": "徐根福",
            "Jshj": 8900,
            "Gmfzrrbz": "N",
            "Tdyslxmc": "",
            "Xsfssjswjgmc": "国家税务总局浙江省税务局"
          }
        ]
      }
    }
  },
  "status": 200
};

// 模拟插件数据格式
const pluginData = {
  batchId: "batch_1763902784583_j9eiuuosl",
  timestamp: "2025-11-23T14:26:41.791Z",
  dataType: "invoice",
  data: [invoiceData]
};

console.log("测试发票数据:");
console.log(JSON.stringify(pluginData, null, 2));

console.log("\n发票数据处理功能已准备就绪！");
console.log("请通过API端点 /api/v1/plugin/data/receive 发送数据进行测试");